<template lang="pug">
  .container.myStudent__main
    .row.content__head
      .col-sm-3
        h2.side__menu__textbook 二维码管理
      .col-sm-9
        h2.content__filter__title 学生列表
        .studentBtn
          .btn__pwd 下载学生账号密码
          .btn__2dCode(@click="handleQRcode") 下载学生二维码
    .row
      .col-sm-3
        h2.side__menu__title 班级
        h3.side__menu__dt 高一
          .selectAll
            span.select-border
            span.desc 全选
        .selectClass
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
        .selectClass
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
        .borderStu

        h3.side__menu__dt 高二
          .selectAll
            span.select-border
            span.desc 全选
        .selectClass
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
        .selectClass
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
        .borderStu

        h3.side__menu__dt 高三
          .selectAll
            span.select-border
            span.desc 全选
        .selectClass
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
        .selectClass
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班
          span.selectItem 一班

      .col-sm-9(v-show="!addNewTutorShow")
        table.homework__tb
          tr
            td 学生号
            td 姓名
            td 学籍号
            td 班级
            td
              .selectAll
                span.select-border
                span.desc 全选
          tr(v-for="item in list")
            td {{item.homeworkName}}
            td {{item.homeworkStatus == "0" ? "未开始" : "已开始"}}
            td {{item.startTime || "-"}}
            td 一班
            td
              .selectAll
                span.select-border
                span.desc
    page

</template>

<style lang="scss" scoped>
  ::-webkit-input-placeholder {
    text-align: left;
  }
  :-moz-placeholder {
    text-align: left;
  }
  ::-moz-placeholder {
    text-align: left;
  }

  .myStudent__main {
    .content__head{
      h2{
        font-size: 24px;
        font-weight: 700;
      }
      .studentBtn{
        float: right;
        .btn__pwd,
        .btn__2dCode{
          border: 1px solid #2186F4;
          border-radius: 6px;
          background: #FAFAFA;
          color: #157FF3;
          font-size: 12px;
          padding: 5px 20px;
          display: inline-block;
          margin-left: 26px;
          cursor: pointer;
        }
      }
    }
    .side__menu__title{
      font-weight: normal;
      margin-top: 12px;
     /* border: 1px solid gray;*/
    }
    .side__menu__dt{
      padding-bottom: 10px;
      padding-right: 10px;
      border-bottom: 1px solid #ECECEC;
    }
    .selectAll{
      float: right;
      font-size: 10px;
      font-weight: normal;
      display: inline-block;
      .select-border {
        width: 14px;
        height: 14px;
        border-radius: 4px;
        border: 1px solid #157EF2;
        display: inline-block;
        vertical-align: middle;
        cursor: pointer;
      }
      .desc{
        margin-left: 4px;
        margin-right: 6px;
      }
    }
    .selectClass{
      margin-left: 10px;
      margin-top: 20px;
      margin-bottom: -6px;
      .selectItem{
        width: 30px;
        height: 30px;
        border: 1px solid #2186F4;
        border-radius: 6px;
        background: #FAFAFA;
        color: #157FF3;
        font-size: 10px;
        padding-left: 4px;
        padding-top: 6px;
        display: inline-block;
        margin-left: 8px;
        margin-right: 8px;
      }
    }
    .borderStu{
      border-bottom: 1px solid #ECECEC;
      margin-top: 26px;
    }

    .homework__tb {
      /*border: 1px solid gray;*/
      span {
        margin-right: 10px;
        cursor: pointer;
        color: $teacherMainColor;
      }
      .select-border{
        font-size: 10px;
        width: 14px;
        height: 14px;
        border-radius: 4px;
        border: 1px solid #157EF2;
        display: inline-block;
        vertical-align: middle;
        cursor: pointer;
      }
      .desc{
        color: #000;
        margin-left: 4px;
        margin-right: 50px;
      }

    }

    .add-list-class {
      background: #FAFAFA;
      border-bottom: 1px solid #ECECEC;
      font-size: 12px;
      .class-student-list {
        margin-right: 28px;
        padding-left: 12%;
        .student {
          display: inline-block;
          margin-right: 28px;
          margin-top: 10px;
          margin-bottom: 20px;
          .student-select {
            width: 18px;
            height: 18px;
            border: 1px solid $teacherMainColor;
            float: left;
            margin-right: 10px;
            cursor: pointer;
          }
          .student-name {
            width: 48px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
        }
      }
    }
    .add-list {
      background: #FAFAFA;
      height: 48px;
      line-height: 48px;
      font-size: 12px;
      border-bottom: 1px solid #ECECEC;
      .list-title {
        float: left;
        width: 12%;
        text-align: right;
        padding-right: 10px;
      }
      .list-content {
        .content-input {
          display: inline-block;
          width: 200px;
          height: 28px;
          line-height: 28px;
          padding-left: 10px;
          border: 1px solid #157EF2;
          color: #A5A5A5;
          border-radius: 4px;
          text-align: left;
        }
        .time-tips {
          color: #FF1905;
          padding-left: 8px;
        }
        .share {
          height: 18px;
          line-height: 18px;
          display: inline-block;
          margin-right: 24px;
          color: $teacherMainColor;
          .share-select {
            border: 1px solid #157EF2;
            border-radius: 4px;
            width: 18px;
            height: 18px;
            display: inline-block;
            vertical-align: middle;
            margin-right: 4px;
            cursor: pointer;
          }
        }
        .class-title {
          .class-select {
            border: 1px solid #157EF2;
            border-radius: 4px;
            width: 18px;
            height: 18px;
            display: inline-block;
            vertical-align: middle;
            margin-right: 4px;
            cursor: pointer;
          }
        }
      }
      .list-btns {
        text-align: center;
        .btn {
          width: 140px;
          display: inline-block;
          margin: 0 auto;
          border: 1px solid #157EF2;
          border-radius: 6px;
          background: #fff;
          color: #157EF2;
          font-size: 12px;
          cursor: pointer;
          padding: 4px 30px;
          box-sizing: border-box;
        }
        .btn:nth-child(even) {
          margin-left: 56px;
        }
        .btn:hover {
          background-color: $teacherMainColor;
          color: #fff;
        }
      }
    }


    .side__menu__list {
      border: 1px solid gray;
      a {
        color: $teacherMainColor;
      }
    }
    .content__filter__order{
      margin-right: 50px;
    }
  }

</style>

<script>
  import api from 'api/tutorship'
  export default {
    data () {
      return {
        list: [],
        addNewTutorShow: false,
        students: [{
          student_id: 1,
          name: 'likaifu'
        }, {
          student_id: 2,
          name: 'mahuateng'
        }, {
          student_id: 3,
          name: '汉语'
        }, {
          student_id: 4,
          name: 'balabalabalbabababababab汉语'
        }, {
          student_id: 5,
          name: '程子昂'
        }, {
          student_id: 6,
          name: '欧阳蛤蟆'
        }, {
          student_id: 7,
          name: '欧阳蛤蟆'
        }, {
          student_id: 8,
          name: '欧阳蛤蟆'
        }, {
          student_id: 9,
          name: '欧阳蛤蟆'
        }]
      }
    },
    mounted () {
      api.getList('2', {
        studentid: '120176400199057431',
        from: 0,
        size: 10
      }).then((Response) => {
        const data = Response.data
        this.list = data.data.list
      })
    },
    methods: {
      toDetail (item) {
        this.$router.push('/teacher/tutorship/' + item.homeworkId)
      },
      addBook () {
        this.$store.commit('addLession', true)
      },
      selectBook () {
        this.$store.commit('switchLession', {
          teacher: true
        })
      },
      addNewTutor () {
        this.addNewTutorShow = true
        console.log('新建作业辅导')
      },
      addTutorSave () {
        this.addNewTutorShow = false
        console.log('save')
      },
      TutorReset () {
        this.addNewTutorShow = false
        console.log('reset')
      },
      handleRuse () {
        this.$store.commit('tutorModifyTime', false)
        this.$store.commit('reUseShow', true)
      },
      handleModifyTime () {
        this.$store.commit('tutorModifyTime', true)
      },
      handleQRcode () {
        this.$store.commit('showQRCode', true)
      }
    }
  }
</script>

